package com.nbsaas.boot.finance.data.entity;

import com.nbsaas.boot.code.annotation.*;
import com.nbsaas.boot.jpa.data.entity.AbstractEntity;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import lombok.Data;
import org.hibernate.annotations.Comment;

import java.math.BigDecimal;
import java.util.Date;

@CreateByUser
@ComposeView
@Data
@FormAnnotation(title = "固定资产", model = "固定资产")
@Entity
@Table(name = "bs_fixed_asset")
@Comment("固定资产表")
public class FixedAsset extends AbstractEntity {

    @Comment("资产编号")
    @SearchItem(name = "assetNo", key = "assetNo", label = "资产编号")
    @FormField(title = "资产编号", sortNum = "1", grid = true, required = true)
    @Column(length = 50, nullable = false, unique = true)
    private String assetNo;

    @Comment("资产名称")
    @SearchItem(name = "name", key = "name", label = "资产名称")
    @FormField(title = "资产名称", sortNum = "2", grid = true, required = true)
    @Column(length = 200, nullable = false)
    private String name;

    @Comment("资产类别")
    @FormField(title = "资产类别", sortNum = "3", grid = true, type = InputType.select)
    @Column(length = 50)
    private String category;

    @Comment("购置日期")
    @FormField(title = "购置日期", sortNum = "4", type = InputType.date, grid = true)
    private Date purchaseDate;

    @Comment("原值")
    @FormField(title = "原值", sortNum = "5", grid = true, type = InputType.el_input_number)
    private BigDecimal originalValue;

    @Comment("净值")
    @FormField(title = "净值", sortNum = "6", grid = true, type = InputType.el_input_number)
    private BigDecimal netValue;

    @Comment("状态")
    @FormField(title = "状态", sortNum = "7", grid = true, type = InputType.select)
    @Column(length = 20)
    private String status;

    @Comment("备注")
    @FormField(title = "备注", sortNum = "8", type = InputType.textarea)
    private String remark;
} 